<template>
  <el-dialog
      title="题目详情"
      v-model="state.visible"
      width="800px"
  >
    <template #footer>       
      <el-button @click="state.visible = false">关 闭</el-button>     
    </template>
  </el-dialog>
</template>

<script setup>
  import { reactive, onMounted, toRefs } from 'vue'
  import { deepClone } from '@/utils'
  const props = defineProps({
    questionList: Array
  })
  const state = reactive({
    visible: false,     //控制本组件的对话框显示和隐藏
    questionList: deepClone(props.questionList)
  });
  // 开启弹窗
  const open = () => {   
    state.visible = true
  };
  // 关闭弹窗
  const close = () => {
    state.visible = false
  };
  // 将需要暴露出去的数据与方法都可以暴露出去
  defineExpose({ open, close })
</script>